recoverWith

inline fun <T> Try<T>.recoverWith(rescue: (Throwable) -> Try<T>): Try<T>

Returns this Try if this is a Success or a Try created by the rescue function if this is a Failure.

Return

This Try if this is a Success or a Try created by the rescue function if this is a Failure.

Parameters

rescue

Function creating a new Try from the exception of a Failure.